import { auth, color, focus } from "./directive/index";
import { createApp } from "vue";
import App from "./App.vue";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "./styles/index.scss";

import { createPinia } from "pinia";
import router from "./router";
// 引入权限控制页面
import "./permission";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import AuthBtn from "./components/AuthBtn.vue";

const app = createApp(App);

app.use(ElementPlus, {
  locale: zhCn, // 使用中文
});
app.use(createPinia());
app.use(router);
// 注册自定义指令
app.directive("focus", focus);
app.directive("color", color);
app.directive("btn-auth", auth);
app.component("btn-perm", AuthBtn);

app.mount("#app");
